export default function get_sessionid() {
	const cookie = document.cookie;
	let sessionid = '';
	if (cookie) {
		// cookie内容格式示例 "user_locale=zh-CN; oschina_new_user=false; tz=Asia%2FShanghai; Hm_lvt_24f17767262929947cc3631f99bfd274=1534838068,1534905172; Hm_lpvt_24f17767262929947cc3631f99bfd274=1535101191"
		if (cookie.indexOf('sessionid') > -1) {
			const coks = cookie.split(';');
			const sess = coks.filter((item) => {
				return item.indexOf('sessionid') > -1;
			});
			if (sess.length > 0) {
				const obj: any = {};
				sess.forEach((se) => {
					const info = se.trim().split('=');
					obj[info[0]] = info[1];
				});
				sessionid = obj.sessionid;
			}
		}
	}
	return sessionid;
}
